<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>头部</title>
    <link rel="stylesheet" type="text/css" href="../../static/left/reset.css"/>
    <link rel="stylesheet" type="text/css" href="../../static/left/common.css"/>
    <script src="../../static/js/jquery-1.12.3.js"></script>
    <script src="../../../static/layer/layer.js"></script>
    <SCRIPT src="../../static/layer/layer.js"></SCRIPT>
    <style>
        .logo h1 {
            font-size: 1.8rem;
            display: inline-block;
            line-height: 60px;
            margin-left: 6.3rem;
            color: #fff;
        }

        .maskpsd {
            display: none;
            width: 100%;
            height: 100%;
            position: fixed;
            top: 0;
            left: 0;
            background-color: rgba(0, 0, 0, 0.1);
            z-index: 999;
        }

        .maskpsd .register {
            position: absolute;
            width: 40%;
            left: 30%;
            top: 25%;
            border: 1px solid #cccccc;
            border-radius: 8px;
            background-color: #fff;
        }

        .maskpsd .register ul {
            padding: 5px 20px 10px;
        }

        .maskpsd .register ul li {
            position: relative;
            padding: 5px 10px;
            border-bottom: 1px solid #ccc;
            min-height: 40px;
            line-height: 40px;
        }

        .maskpsd .register ul li h3 {
            display: inline-block;
            font-size: 18px;
            font-weight: bold;
            color: #666;
        }

        .maskpsd .register ul li .closeBtn1 {
            cursor: pointer;
            position: absolute;
            top: 0;
            right: 0;
        }

        .maskpsd .register ul li .regSpan {
            display: inline-block;
            width: 100px;
            text-align: left;
            margin-right: 10px;
        }

        .maskpsd .register ul li input[type=password] {
            width: 50%;
            height: 30px;
            line-height: 40px;
            border: 1px solid #dedcdc;
            border-radius: 5px;
            background-color: #F7F7F7;
            font-size: 16px;
            padding-left: 10px;
            box-sizing: border-box;
        }

        .regUser1 {
            width: 4rem;
            cursor: pointer;
        }

        .change_psd {
            display: inline-block;
            color: #fff;
            float: right;
            margin-right: 5%;
            line-height: 60px;
            font-size: 14px;
            cursor: pointer;
        }
    </style>
</head>

<body>
<div class="head clearfix">
    <div class="logo">
        {#    	<a href=""><img src="../../static/left/logo.png" alt="点学教育"/></a>#}
        <h1>管理后台</h1>
    </div>
    <div class="change_psd">修改密码</div>
</div>
<div class="maskpsd">
    <div class="register">
        <ul class="regBox">
            <li>
                <h3>修改密码</h3>
                <span class="xxx closeBtn1">关闭</span>
            </li>
            <li>
                <span class="regSpan">请输入当前密码</span>
                <input type="password" title="" class="uname" id="a_id">
            </li>
            <li>
                <span class="regSpan">请输入新密码</span>
                <input type="password" title="" class="uname" id="ps1">
            </li>
            <li>
                <span class="regSpan">再次输入新密码</span>
                <input type="password" title="" class="uname" id="ps2">
            </li>
            <li>
                <button class="regUser1" id="tj">提交</button>
            </li>
        </ul>
    </div>
</div>
<script>
    $('.change_psd').click(function () {
        $('.maskpsd').show();
    });
    $('.closeBtn1').click(function () {
        $('.maskpsd').hide();
    })
    $('#tj').click(function () {
        var old_psd = $('#a_id').val();  //当前密码
        var ps1 = $('#ps1').val();  //新密码
        var ps2 = $('#ps2').val();  //新密码
        if (ps1 != ps2 || ps1 == '' || ps2 == '') {
            layer.msg("新密码输入有误！");
        } else {
            $.ajax({
                url: '/admin/update/password',
                type: 'post',
                data: {
                    old_password: old_psd,
                    password: ps1
                },
                success: function (msg) {
                    console.log(msg)
                    if (msg.res == "success") {
                        layer.msg("操作成功！", {time: 2000}, function () {
                            window.location.href = "/admin/login.html";
                        });


                    } else {
                        layer.msg("操作失败！");
                    }
                }
            })
        }

    })
</script>

</body>
</html>

